//默认绑定
function girl() {
    console.log(this)
}

girl()   //浏览器输出window


//隐式绑定
var gril1 = {
    name: '小红', details: function () {
        console.log(this.name);
    }
}
gril1.details();


//硬绑定
var gril2 = {
    name: '小白'
}
gril1.details.call(gril2)
gril1.details.apply(gril2)



//构造函数绑定
function Lover(name) {
    this.name = name;
    this.getName = function () {
        console.log(this.name)
    }
}
var xiaoHong = new Lover('小红')
xiaoHong.getName();




